package com.example.cloudorder.web;

import com.example.cloudorder.entity.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class orderAction {
    @Value("${server.port}")
    String port;

    @RequestMapping("/order")
    String toIndex(){
        return "order:"+port;
    }

    @RequestMapping("/hello")
    String hello(String name){
        return "hello"+name;
    }

    @RequestMapping("/add")
    int add(int a,int b){
        return a+b;
    }

    @RequestMapping("/user")
    User user(@RequestBody User user){
        return user;
    }

}
